<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org"
>
<head>
    <script th:src="@{/vendor/jquery/jquery.min.js}"></script>
    <script th:src="@{/vendor/bootstrap/js/bootstrap-table.js}"></script>
    <!--BootstrapCoreJavaScript-->
    <script th:src="@{/vendor/bootstrap/js/bootstrap.min.js}"></script>
    <!--MetisMenuPluginJavaScript-->
    <script th:src="@{/vendor/metisMenu/metisMenu.min.js}"></script>
    <!--CustomThemeJavaScript-->
    <script th:src="@{/dist/js/sb-admin-2.js}"></script>
    <script th:src="@{/vendor/datepicker/bootstrap-datepicker.js}"></script>
    <link href="/vendor/bootstrap/css/bootstrap-table.css" rel="stylesheet">
    <link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!--MetisMenuCSS-->
    <link href="/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
    <!--CustomCSS-->
    <link href="/dist/css/sb-admin-2.css" rel="stylesheet">
    <link href="/vendor/datepicker/datepicker3.css" rel="stylesheet">
    <!--CustomFonts-->
    <link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <meta charset="UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>CreditAmountRecheckPage</title>

    <!--BootstrapCoreCSS-->


</head>

<body>

<div id="page-User">
    <ul id="myTab" class="nav nav-tabs">
        <li class="active">
            <a href="#home" data-toggle="tab">
                额度复核信息
            </a>
        </li>
        <li><a href="javascript:void(0)" id="saveAction">保存</a></li>
        <li><a href="javascript:void(0)" id="exitAction">退出</a></li>
    </ul>
    <div class="tab-pane fade in active" id="home">
        <form id="Info" th:action="@{/CreditAmountRecheckPage}"
              th:object="${creditAmountRecheck_entity}"
              method="post" onsubmit="beforeSubmit()">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">额度复核信息</a>
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapsein">
                    <div class="panel-body">
                        <br/>

                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>贷款编码:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{refnum}"
                                           name="refnum" maxlength="13" id="refnum" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>客户号:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{obkgid}"
                                           name="obkgid" maxlength="12" id="obkgid" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>客户名:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{custnm}"
                                           name="custnm" maxlength="50" id="custnm" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>额度号:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{obkglin}"
                                           name="obkglin" maxlength="5" id="obkglin" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>贷款类型:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{lntype}"
                                           name="lntype" maxlength="3" id="lntype" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>币种:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{prdccy}"
                                           name="prdccy" maxlength="3" id="prdccy" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>金额:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{obkgamt}"
                                           name="obkgamt" maxlength="17" id="obkgamt" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>操作人员:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{bkuser}"
                                           name="bkuser" maxlength="10" id="bkuser" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>日期时间:</label>
                                </div>
                                <div class="col-lg-4">
                                    <input class="form-control" th:field="*{bokdate}"
                                           name="bokdate" id="bokdate" readonly>
                                </div>
                                <div class="col-lg-4">
                                    <input class="form-control" th:field="*{boktime}"
                                           name="boktime" maxlength="6" id="boktime" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>复核原因:</label>
                                </div>
                                <div class="col-lg-8">
                                    <textarea class="form-control" row="3" th:field="*{pdgrsn}" name="pdgrsn"
                                              readonly id="pdgrsn" maxlength="100"></textarea>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>操作:</label>
                                </div>
                                <div class="col-lg-8">
                                    <div class="radio">
                                        <div class="col-lg-6">
                                            <label>
                                                <input type="radio" name="chooseAction" id="optionAgree"
                                                       value="A">同意
                                            </label>
                                        </div>
                                        <div class="col-lg-6">
                                            <label>
                                                <input type="radio" name="chooseAction" id="optionDecline"
                                                       value="R" checked>退回
                                            </label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <input class="form-control" id="actcode" type="hidden" name="actcode" th:field="*{actcode}">
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>备注:</label>
                                </div>
                                <div class="col-lg-8">
                                    <textarea class="form-control" row="3" th:field="*{apprmk1}" name="apprmk1"
                                              id="apprmk1" maxlength="25"></textarea>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>第一次复核人员Id:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{appid1}"
                                           name="appid1" maxlength="10" id="appid1" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>第一次复核人姓名:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control"
                                           name="firstApproverName" maxlength="25" id="firstApproverName" readonly>
                                </div>
                            </div>
                        </div>
                        <br/>
                        <div class="row">
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>复核日期:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{appdat1}"
                                           name="appdat1" id="appdat1" readonly>
                                </div>
                            </div>
                            <div class="col-lg-6">
                                <div class="col-lg-4">
                                    <label>复核时间:</label>
                                </div>
                                <div class="col-lg-8">
                                    <input class="form-control" th:field="*{apptim1}"
                                           name="apptim1" maxlength="6" id="apptim1" readonly>
                                </div>
                            </div>
                        </div>

                    </div>
                </div>
            </div>


            <div class="row">
                <div class="col-lg-4"></div>
                <div class="col-lg-4" align="center">
                    <button type="reset" class="btn btn-primary">重填</button>
                    <button type="submit" class="btn btn-primary">保存</button>
                </div>
                <div class="col-lg-4"></div>
            </div>

        </form>
    </div>
</div>


<script>
    function beforeSubmit() {
        $('#actcode').val($("input[name='chooseAction'][checked]").val());
        var now = new Date();
        var year = now.getFullYear();
        var month = now.getMonth() + 1;
        if (month < 10) {
            month = "0" + month;
        }
        var date = now.getDate();
        if (date < 10) {
            date = "0" + date;
        }
        $('#appdat1').val(year + "" + month + "" + date);
        var hour = now.getHours();
        if (hour < 10) {
            hour = "0" + hour;
        }
        var min = now.getMinutes();
        if (min < 10) {
            min = "0" + min;
        }
        var sec = now.getSeconds();
        if (sec < 10) {
            sec = "0" + sec;
        }
        $('#apptim1').val(hour + "" + min + "" + sec);
        return true;
    }

    $(document).ready(function () {
        if ($('#refnum').val().replace(/(^\s*)|(\s*$)/g, "") != '')
            $.ajax({
                type: 'get',
                url: '/CreditAmountRecheckPage/getCustnm?refnum=' + $('#refnum').val(),
                contentType: 'application/json',
                success: function (data) {
                    $('#custnm').val(data);
                },
                error: function () {
                    alert("获取客户数据失败");
                }
            })
        if ($('#appid1').val().replace(/(^\s*)|(\s*$)/g, "") != '')
            $.ajax({
                type: 'get',
                url: '/CreditAmountRecheckPage/getFirstApproverName?UserIdCode=' + $('#appid1').val(),
                contentType: 'application/json',
                success: function (data) {
                    $('#firstApproverName').val(data);
                },
                error: function () {
                    alert("获取员工数据失败");
                }
            })
        $('#apprmk1').val($('#apprmk1').val().replace(/(^\s*)|(\s*$)/g, ""));
    });

    $('#saveAction').click(function () {
        $('#Info').submit();
    });

    $('#exitAction').click(function () {
        if (navigator.appName == "Netscape") {
            window.location.href = 'about:blank ';
//            window.opener=null;
//            window.open('','_self');
//            window.close();
        } else if (navigator.appName == "Firefox") {
            window.location.href = 'about:blank ';
        }
        else {
            window.close();
        }
    });

</script>
</body>

</html>
